Skip to content

Conversation

@vicLin8712
Copy link
Collaborator

@vicLin8712 vicLin8712 commented Nov 22, 2025

The introduction of the logger task in previous commits changed the task creation order, which caused inconsistencies in fixed task ID assignments.

This commit binds the task ID directly from the creation parameter, ensuring deterministic and correct ID assignment regardless of task creation order.


Summary by cubic

Fixes task ID mismatches in suspend.c by using the IDs returned from mo_task_spawn instead of hardcoded indices. This makes suspend/resume deterministic even if task creation order changes (e.g., after adding the logger task).

  • Bug Fixes
    • Store task IDs (task0_id, task1_id, task2_id) from mo_task_spawn.
    • Use stored IDs in mo_task_resume/mo_task_suspend to target the correct task.

Written for commit c514fde. Summary will update automatically on new commits.

The introduction of the logger task in previous commits changed the
task creation order, which caused inconsistencies in fixed task ID
assignments.

This commit binds the task ID directly from the creation parameter,
ensuring deterministic and correct ID assignment regardless of task
creation order.
cubic-dev-ai[bot]

This comment was marked as resolved.

@visitorckw
Copy link
Collaborator

Are we able to identify specifically which commits are referred to as 'previous commits' in the description?

@vicLin8712
Copy link
Collaborator Author

Are we able to identify specifically which commits are referred to as 'previous commits' in the description?

Refer to #41

mo_task_spawn() is called in mo_logger_init() and mo_logger_init() is called before the creation of costumer applications, which causes task ID error used in suspend.c

@visitorckw
Copy link
Collaborator

Thanks. I think it would be worthwhile to include these in the description. That way, it will be easier for both current reviewers and future readers to track down the code that introduced the issue we are fixing.

@vicLin8712
Copy link
Collaborator Author

Thanks. I think it would be worthwhile to include these in the description. That way, it will be easier for both current reviewers and future readers to track down the code that introduced the issue we are fixing.

Thanks for your feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants